<template>
	<view class="box">
		<view class="upload" @click="uploadHandle">
			<image :src="imgPath"></image>
		</view>
		<input type="text" placeholder="输入歌单名称" placeholder-class="inp"/>
		<button>完成</button>
	</view>
</template>

<script>
	export default {
		data () {
			return {
				imgPath: ""
			}
		},
		methods: {
			// 点击upload盒子 调用上传api，实现图片上传
			uploadHandle () {
				uni.chooseImage({
					count: 1,
					success: (path) => {
						console.log(path)
						// 判断是否获取成功
						if (path.errMsg !== "chooseImage:ok") {
							return false
						}
						this.imgPath = path.tempFilePaths
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.box {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		.upload {
			width:232rpx;
			height:232rpx;
			background:rgba(161,171,194,1) url(../../static/tianjiagedan.png) no-repeat center;
			background-size: 72rpx;
			border-radius:10rpx;
			margin-top: 82rpx;
			image {
				width: 100%;
				height: 100%;
			}
		}
		input {
			width:646rpx;
			height:98rpx;
			background:rgba(242,242,242,1);
			border-radius:4rpx;
			margin: 78rpx 0 92rpx;
			padding-left: 44rpx;
			box-sizing: border-box;
			.inp {
				width:184rpx;
				height:42rpx;
				font-size:30rpx;
				font-family:PingFangSC-Regular,PingFang SC;
				font-weight:400;
				color:rgba(191,191,191,1);
				line-height:42rpx;
			}
		}
		button {
			width:646rpx;
			height:94rpx;
			background:rgba(20,145,255,1);
			border-radius:4rpx;
		}
	}
</style>
